package com.briup.corejava.day07;

/**
 * 类的初识
 */
public class Test1 {
    public static void main(String[] args) {
        // 实例化 -> 创建对象
        Hero hero1 = new Hero();
        hero1.name = "墨菲特";
        Hero hero2 = new Hero();
        hero2.name = "阿萝拉";
        hero2.q(); //  类中 -> 成员方法 -> 声明不带static

        // 创建两个手机对象
        Phone phone1 = new Phone();
        // 整形 0 浮点 0.0 boolean false 引用 null
        System.out.println(phone1.brand);
        System.out.println(phone1.price);
        phone1.brand = "iPhone 15 pro max";
        phone1.price = 8999;
        phone1.call();
        phone1.sendMassage("tom","今天中午吃什么");

        Phone phone2 = new Phone();
        phone2.brand = "huawei mate 60";
        phone2.price = 6999;
        phone2.call();
        phone2.sendMassage("jerry", "回锅肉");

        // 引用的赋值
        Phone phone3 = phone2;

        // 创建Account对象，进行赋值和取值
        Account account = new Account();
        account.setBalance(1000.00);
        System.out.println(account.getBalance());
        System.out.println(account.isAvailable());

        Account a1 = new Account();
        System.out.println(a1);
        a1.print(); // this = a1;

        Account a2 = new Account();
        System.out.println(a2);
        a2.print(); // this = a2;

    }
}
// 一个java文件中可以额外定义其余的class
// 做一次游戏角色设计师，设计一个英雄的形象、技能




